# MakeBy: LiuBoyuan



class UserListEnum:  # 游玩该游戏的玩家所有的数据
    GuanQia = "U关卡"
    HECHENG = "U合成"
    SHANGCHENG = "U商城"
    BUFF = "UBuff"
    JUQING = "U剧情"
    SHIJIAN = "U事件"
    JUESE = "U角色"
    JINENG = "U技能"
    CUFAQI = "U触发器"


class ALLListEnum:  # 该项目存在的所有数据
    GuanQia = "A关卡"
    HECHENG = "A合成"
    SHANGCHENG = "A商城"
    BUFF = "ABuff"
    JUQING = "A剧情"
    SHIJIAN = "A事件"
    JUESE = "A角色"
    JINENG = "A技能"
    CUFAQI = "A触发器"


class MutationsUser:  # 设置该项目存在的所有数据的函数
    GUANKA = "M关卡"
    HECHENG = "M合成"
    SHANGCHENG = "M商城"
    BUFF = "MBuff"
    JUQING = "M剧情"
    SHIJIAN = "M事件"
    JUESE = "M角色"
    JINENG = "M技能"
    CUFAQI = "M触发器"


def lasting_effect_lost(buff):
    newBuffs = []
    keyname = 'lasting_effect'
    userbuffs = UserListEnum.BUFF
    for _buff in newBuffs:
        if buff.name == _buff.name:
            _buff[keyname] -= 1
            if _buff[keyname] < 0:
                continue


def buff_has_flag(buffs, buffname):
    for i in buffs:
        name = i.get("name")
        if name == buffname:
            return True
    return False
